<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateAliyunEquipment extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_aliyun_equipment', function (Blueprint $table) {
            $table->id();
            $table->string("deviceName", 100)->default('')->index('idx_deviceName')->comment("dn 码");
            $table->string("productKey", 100)->default('')->index('idx_productKey')->comment("pk 码");
            $table->string("deviceSecret", 100)->default('')->index('idx_deviceSecret')->comment("ds 码");
            $table->char("version", 20)->default('')->comment("版本号 值为导入当天时间");
            $table->unsignedInteger('bindingId')->default(0)->comment('绑定的设备 ID');
            $table->unsignedTinyInteger('type')->default(1)->comment('类型 1: nvr 2摄像头');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('更新时间');
            $table->tinyInteger("isDeleted")->default(0)->comment("是否删除,0:未删除,1:已删除");

            $table->comment = '阿里云设备库';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_aliyun_equipment');
    }
}
